<!DOCTYPE html>
<html lang="zh-cn">
    <head>
        <meta charset="UTF-8"/>
        <meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0" />
        <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
        <title>Document</title>
    </head>
    <body>
      <h1>ES6入门标准</h1>
      <p>来源:<a href="http://es6.ruanyifeng.com/#docs/let">http://es6.ruanyifeng.com/#docs/let</a></p>
        <script>
            // var a = [];
            // for (var i = 0; i < 10; i++) {
            //   a[i] = function () {
            //     console.log(i);
            //   };
            // }
            // a[6](); // 10
            var a = [];
            for (let i = 0; i < 10; i++) {
              a[i] = function () {
                console.log(i);
              };
            }
            a[6](); // 6
            for (let i = 0; i < 3; i++) {
              let i = 'abc';
              console.log(i);
            }
        </script>
    </body>
</html>